package com.example.neo4j.service;
import com.example.neo4j.enty.Know;
import org.springframework.data.neo4j.repository.Neo4jRepository;

import org.springframework.data.neo4j.repository.query.Query;
import org.springframework.data.repository.query.Param;

/**

 * @program: neo4jdemo

 * @description: 知道关系接口类

 * @author: chen

 * @create: 2020-07-27

 **/

public interface KnowRepository extends Neo4jRepository<Know,Long> {

    @Query("MATCH (fromNode) WHERE id(fromNode) = {fromId} MATCH (toNode) WHERE id(toNode) = {toId} MATCH (fromNode)-[r]->(toNode) DELETE r")

    void deleteByNodeId(@Param(value = "fromId") long fromId,@Param(value = "toId") long toId);

}
